package main

import (
	"fmt"
	Day3 "hello/chapter3"
	router_all "hello/router"
	"html/template"

	"github.com/gin-gonic/gin"
)

func main() {
	router := gin.Default()
	//全局使用中间件
	// router.Use(Chapter4.Midware, Chapter4.Midware2(), Chapter4.Midware3)
	router.SetFuncMap(template.FuncMap{"add": Day3.Add, "timeTr": Day3.TimeTransfer})
	router.LoadHTMLGlob("template/**/*")
	router.Static("/static", "static")
	// router.GET("/", func(ctx *gin.Context) {
	// 	ctx.String(200, "hello world")
	// })

	router_all.Router(router)
	router.Run(":8080")
	fmt.Print("hello world\n")
}
